<template>
  <div class="off-model">
    <div class="component">
      <img src="@/assets/icon13.png" alt="" />
      <span>{{ data.component | Mes }}</span>
    </div>
    <div class="text">
      <p class="title">{{ data.title }}</p>
      <p class="act">{{ data.article }}</p>
      <p class="time">{{ data.dataTime | Time }}</p>
    </div>
    <div class="img" :style="`background-image:url(${data.images})`"></div>
  </div>
</template>

<script>
export default {
  props: ["Data"],
  data() {
    return {
      data: this.Data,
    };
  },
  mounted() {
    // console.log(this.data);
  },
  filters: {
    Time(value) {
      let s = new Date(value);
      let m = s.getMonth() + 1;
      m = m < 10 ? "0" + m : m;
      let d = s.getDate();
      d = d < 10 ? "0" + d : d;
      return `${m}-${d}`;
    },
    Mes(value) {
      if (value > 10000) {
        return (value / 10000).toFixed(1) + "万";
      }
    },
  },
};
</script>

<style scoped>
.off-model {
  background: white;
  width: 100%;
  display: flex;
  justify-content: space-evenly;
  padding: 20px 0 ;
  border-bottom: 1px dashed #999;
}
.text {
  width: 50%;
}
.component {
  position: relative;
  width: 42px;
}
.component img {
  width: 100%;
}
.component span {
  width: 100%;
  left: 68%;
  top: 10%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  position: absolute;
  color: #1fbbf4;
}
.text .title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}
.text .act {
  height: 76px;
  color: #999;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  /* white-space:nowrap ; */
}
.text .time {
  margin-top: 10px;
  color: #999;
  font-size: 12px;
}
.img {
  width: 242px;
  height: 106px;
  background-position: 50%;
  background-size: 100%;
  background-repeat: no-repeat;
}
</style>